// 统一的key
const TOKEN_KEY = 'itcast_geek_pc'

// 获取
const getToken = () => localStorage.getItem(TOKEN_KEY)
// 设置
const setToken = (token) => localStorage.setItem(TOKEN_KEY, token)
// 清除
const clearToken = () => localStorage.removeItem(TOKEN_KEY)
// 判断是否有token
// !! 把后面的那个值转为与之对应的布尔值
// !xxx-->取反
// !! 取反2次
const isAuth = () => !!getToken()

export { isAuth, getToken, setToken, clearToken }
